﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DienLib.SummitLib
{
    class ReflectType
    {
        public static Type UltraTreeUIElement { get; private set; }
        public static Type NodeSelectableAreaUIElement { get; private set; }
        public static Type ControlUIElementBase { get; private set; }
        public static Type UltraTreeNode { get; private set; }
        public static Type TreeNodesCollection { get; private set; }
        public static Type UIElement { get; private set; }
        public static Type UltraTree { get; private set; }
        public static Type UltraControlBase { get; private set; }
        public static Type TreeNodeUIElement { get; private set; }
        
        /// <summary>
        /// Init All Reflection Type use in Summit
        /// </summary>
        /// <param name="SummitJobTree">The Job.UI.UltraWinTree::Infragistics.Win.UltraWinTree.UltraTree</param>
        public static void InitFromObject(object SummitJobTree = null)
        {
            if (SummitJobTree != null)
            {
                UltraTree = SummitJobTree.GetType().BaseType; // UltraWinTree::UltraTree
                UltraControlBase = UltraTree.BaseType;

                TreeNodeUIElement = UltraTree.Assembly.GetType("Infragistics.Win.UltraWinTree.TreeNodeUIElement");
                UltraTreeUIElement = UltraTree.Assembly.GetType("Infragistics.Win.UltraWinTree.UltraTreeUIElement");
                NodeSelectableAreaUIElement = UltraTree.Assembly.GetType("Infragistics.Win.UltraWinTree.NodeSelectableAreaUIElement");
                UltraTreeNode = UltraTree.Assembly.GetType("Infragistics.Win.UltraWinTree.UltraTreeNode");
                TreeNodesCollection = UltraTree.Assembly.GetType("Infragistics.Win.UltraWinTree.TreeNodesCollection");
                
                ControlUIElementBase = UltraControlBase.Assembly.GetType("Infragistics.Win.ControlUIElementBase");
                UIElement = UltraControlBase.Assembly.GetType("Infragistics.Win.UIElement");
            }
        }
    }
}
